import request from "@/utils/request";

export function getOneLevelCommentsByPostId(data) {
  return request({
    url: '/post/comment/query/oneLevelByPostId/' + data.postId + '/' + data.isLikeNumberSort,
    method: 'get',
    params: data
  })
}

export function getCommentsCountByPostId(data) {
  return request({
    url: '/post/comment/query/countByPostId/' + data.postId,
    method: 'get',
    params: data
  })
}

export function userSendComment(data) {
  return request({
    url: '/post/comment/publish',
    method: 'post',
    data
  })
}

export function flatChildByParentId(data) {
  return request({
    url: '/post/comment/query/flatChildByParentId/' + data.parentId + '/' + data.isLikeNumberSort,
    method: 'get',
    params: data
  })
}

export function deleteCommentById(data) {
  return request({
    url: '/post/comment/deleteById/' + data.id,
    method: 'delete',
    data
  })
}

export function getCommentInfo(data) {
  return request({
    url: '/post/comment/query/infoById/' + data.id,
    method: 'get',
    params: data
  })
}

export function userLikeComment(data) {
  return request({
    url: '/post/comment/like',
    method: 'put',
    data
  })
}

export function replyByUserId(data) {
  return request({
    url: '/post/comment/query/replyByUserId/' + data.userId,
    method: 'get',
    params: data
  })
}
